//
//  ButtonDemo.m
//  Exercise
//
//  Created by zhouxiaobo on 15/11/12.
//  Copyright © 2015年 mapath. All rights reserved.
//

#import "ButtonDemo.h"

@interface ButtonDemo ()

@end

@implementation ButtonDemo

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeContactAdd];
    btn1.frame = CGRectMake(screenWidth/6 - 20, 30, 40, 40);
    [self.view addSubview:btn1];
    
    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    btn2.frame = CGRectMake(screenWidth/6 + 40 - 20, 30, 40, 40);
    [self.view addSubview:btn2];
    
    UIButton *btn3 = [UIButton buttonWithType:UIButtonTypeInfoLight];
    btn3.frame = CGRectMake(screenWidth/6 + 40*2 - 20, 30, 40, 40);
    [self.view addSubview:btn3];
    
    UIButton *btn4 = [UIButton buttonWithType:UIButtonTypeInfoDark];
    btn4.frame = CGRectMake(screenWidth/6 + 40*3 - 20, 30, 40, 40);
    [self.view addSubview:btn4];
    
    UIButton *btn5 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn5.frame = CGRectMake(screenWidth/6 + 40*4 - 20, 30, 40, 40);
    [btn5 setTitle:@"Hello" forState:UIControlStateNormal];
    [btn5 setTitle:@"Hello" forState:UIControlStateHighlighted];
    [self.view addSubview:btn5];
    
    UIButton *btn6 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn6.frame = CGRectMake(screenWidth/6 + 40*5 - 20, 30, 40, 40);
    [btn6 setImage:[UIImage imageNamed:@"weibo-up"] forState:UIControlStateNormal];
    [btn6 setImage:[UIImage imageNamed:@"weibo-down"] forState:UIControlStateSelected];
    [btn6 setImage:[UIImage imageNamed:@"weibo-down"] forState:UIControlStateHighlighted];
    [btn6 addTarget:self action:@selector(weibologin:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:btn6];
    
}

- (void) weibologin:(UIButton *)button {
    NSLog(@"微博登录");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
